/**
 * customer服务
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.service;


import com.sxf.crm.dto.CustomerDepartmentDTO;
import com.sxf.crm.dto.CustomerDTO;
import com.sxf.crm.entity.Customer;
import com.sxf.crm.enums.CustomerStage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Service interface for customer management operations.
 * Provides methods for CRUD operations, department associations, and approval workflows.
 */
public interface CustomerService {
    Page<CustomerDTO> getCustomers(String name, CustomerStage stage, String source, String status, Pageable pageable);
    
    CustomerDTO getCustomer(Long id);
    
    CustomerDTO createCustomer(CustomerDTO customer);
    
    CustomerDTO updateCustomer(Long id, CustomerDTO customer);
    
    void deleteCustomer(Long id);
    
    CustomerDTO approveCustomer(Long id, boolean approved, String comment);
    
    List<CustomerDepartmentDTO> getCustomerDepartments(Long customerId);
    
    void addCustomerDepartment(Long customerId, Long departmentId, Long salesId);
    
    void deleteCustomerDepartment(Long customerId, Long departmentId);

    List<CustomerDTO> searchCustomers(String query);

    Customer findById(Long id);
}
